#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: LiangChao
@email：kevinleong1011@hotmail.com

@desc: 
"""
from makitest.errors import TestError


class GrammarError(TestError):
    """Grammar error"""


class KeywordRegisteredError(GrammarError):
    """Keyword has been registered in grammar manager."""


class InvalidSentenceError(GrammarError):
    """"""

    def __init__(self, grammar_fmt, sentence):
        self.grammar_fmt = grammar_fmt
        self.sentence = sentence
        self.message = f'Your sentence: {self.sentence}, Grammar format: {self.grammar_fmt}'
        super().__init__(self.message)

    def __repr__(self):
        return f'InvalidSentenceError: {self.sentence}, correct grammar format is {self.grammar_fmt}'
